package com.subang.function.service.impl;

import java.util.List;
import com.subang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.subang.function.mapper.SbPkRoomMapper;
import com.subang.function.domain.SbPkRoom;
import com.subang.function.service.ISbPkRoomService;

/**
 * PK答题房间信息Service业务层处理
 * 
 * @author subei
 * @date 2025-09-14
 */
@Service
public class SbPkRoomServiceImpl implements ISbPkRoomService 
{
    @Autowired
    private SbPkRoomMapper sbPkRoomMapper;

    /**
     * 查询PK答题房间信息
     * 
     * @param id PK答题房间信息主键
     * @return PK答题房间信息
     */
    @Override
    public SbPkRoom selectSbPkRoomById(Long id)
    {
        return sbPkRoomMapper.selectSbPkRoomById(id);
    }

    /**
     * 查询PK答题房间信息列表
     * 
     * @param sbPkRoom PK答题房间信息
     * @return PK答题房间信息
     */
    @Override
    public List<SbPkRoom> selectSbPkRoomList(SbPkRoom sbPkRoom)
    {
        return sbPkRoomMapper.selectSbPkRoomList(sbPkRoom);
    }

    /**
     * 新增PK答题房间信息
     * 
     * @param sbPkRoom PK答题房间信息
     * @return 结果
     */
    @Override
    public int insertSbPkRoom(SbPkRoom sbPkRoom)
    {
        sbPkRoom.setCreateTime(DateUtils.getNowDate());
        return sbPkRoomMapper.insertSbPkRoom(sbPkRoom);
    }

    /**
     * 修改PK答题房间信息
     * 
     * @param sbPkRoom PK答题房间信息
     * @return 结果
     */
    @Override
    public int updateSbPkRoom(SbPkRoom sbPkRoom)
    {
        return sbPkRoomMapper.updateSbPkRoom(sbPkRoom);
    }

    /**
     * 批量删除PK答题房间信息
     * 
     * @param ids 需要删除的PK答题房间信息主键
     * @return 结果
     */
    @Override
    public int deleteSbPkRoomByIds(Long[] ids)
    {
        return sbPkRoomMapper.deleteSbPkRoomByIds(ids);
    }

    /**
     * 删除PK答题房间信息信息
     * 
     * @param id PK答题房间信息主键
     * @return 结果
     */
    @Override
    public int deleteSbPkRoomById(Long id)
    {
        return sbPkRoomMapper.deleteSbPkRoomById(id);
    }
}
